package com.bjpowernode.controller;

import com.bjpowernode.form.RuleForm;
import com.bjpowernode.service.AdminService;
import com.bjpowernode.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@CrossOrigin
@Controller
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    AdminService adminService;
    @PostMapping("/login")
    @ResponseBody
    public ResultVO login(RuleForm ruleForm){
        ResultVO resultVO = adminService.login(ruleForm);
        return resultVO;
    }
    @PostMapping("/enroll")
    @ResponseBody
    public ResultVO enroll(RuleForm ruleForm){
        ResultVO resultVO = adminService.enroll(ruleForm);
        return resultVO;
    }
}
